package com.dingup.mock.feign.client;


import com.dingup.api.adapter.user.SysUserAdapter;
import com.dingup.api.bean.response.SelectBean;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * Created by wancheng on 2018/7/5.
 */
@Component
@FeignClient(value = "p-innermgrweb") //这里的name对应调用服务的spring.applicatoin.name
public interface UserFeignClient {

    @RequestMapping(value = "/feign/user/get_user_name_by_id.do", method = RequestMethod.POST)
    public String getUserNameByUserId(@RequestParam("userId") String userId);

    @RequestMapping(value = "/feign/user/get_all_user_name.do", method = RequestMethod.POST)
    public List<SelectBean> getAllUserName();

    @RequestMapping(value = "/feign/user/get_user_by_user_id.do", method = RequestMethod.POST)
    public SysUserAdapter getUserByUserId(@RequestParam("userId") String userId);

    /**
     * 获取user绑定的openId
     *
     * @param userId
     * @return
     */
    @RequestMapping(value = "/feign/user/get_user_wx_open_id.do", method = RequestMethod.POST)
    public String getWxOpenId(@RequestParam("userId") String userId);

    /**
     * 系统用户
     *
     * @return
     */
    @RequestMapping(value = "/feign/user/get_user_from_system.do", method = RequestMethod.POST)
    public List<SelectBean> getUserFromSystem();

    /**
     * 获取家长openid
     *
     * @param userId
     * @return
     */
    @RequestMapping(value = "/feign/user/get_parent_wx_open_id.do", method = RequestMethod.POST)
    public List<String> getParentWxOpenId(@RequestParam("userId") String userId);


}
